import {
  CaloriesMap,
  BmiCaloriesIndexMap,
  PregnantWeekCaloriesIndexMap,
} from "@/common/constants/CaloriesDefinition";
export default function getCalories(bmi, pregnantWeek) {
    let bmiIndex,pregnantWeekIndex;
    for (let i in BmiCaloriesIndexMap){
        if(bmi >= BmiCaloriesIndexMap[i][0] && bmi < BmiCaloriesIndexMap[i][1]){
            bmiIndex = i;
        }
    }
    for (let i in PregnantWeekCaloriesIndexMap){
        if(pregnantWeek >= PregnantWeekCaloriesIndexMap[i][0] && pregnantWeek <= PregnantWeekCaloriesIndexMap[i][1]){
            pregnantWeekIndex = i;
        }
    }
    return CaloriesMap[bmiIndex][pregnantWeekIndex];
}